package com.gt.web.controller.app;

import com.gt.app.domain.EsScreenProjectUser;
import com.gt.app.domain.dto.EsScreenProjectDto;
import com.gt.app.service.EsScreenProjectUserService;
import com.gt.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.gt.app.service.EsScreenProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * <p>
 * 筛查项目表 前端控制器
 * </p>
 *
 * @author caidesheng
 */
@Slf4j
@RestController
@RequestMapping("esScreenProject")
@Api(tags = "筛查项目接口")
public class EsScreenProjectController {

    @Autowired
    private EsScreenProjectService  esScreenProjectService;

    @ApiOperation(value = "获取项目列表")
    @GetMapping(value = "getStatus")
    public AjaxResult getStatus() {
        List<EsScreenProjectDto> esScreenProjectDtos = esScreenProjectService.getStatus();
        return AjaxResult.success(esScreenProjectDtos);
    }

    @ApiOperation(value = "通过项目id参与项目")
    @GetMapping(value = "getCheckId")
    public AjaxResult getCheckId(Long id) {
        String checkId = esScreenProjectService.getCheckId(id);
        return AjaxResult.success().put("checkId",checkId);
    }

    @ApiOperation(value = "筛查记录")
    @GetMapping(value = "getScreenRecord")
    public AjaxResult getScreenRecord(String checkId) {
        List<EsScreenProjectDto> list = esScreenProjectService.getScreenRecord();
        return AjaxResult.success(list);
    }

}
